feat(stack): gstack-style non-destructive update mechanism - #11
Merged
Conversation
Make stack updates detectable and safe so the method can evolve constantly without ever destroying a user's personalization. Built on the "reference, don't copy" principle: the shared layer is this git clone, personal configs only reference it (@AGENTS.md), so a `git pull` updates everyone while each user keeps their customizations. - VERSION (semver) + stack-version header in AGENTS.md — version source of truth - scripts/stack-update-check.sh — read-only detection (fetch + compare, never modifies anything; safe in a SessionStart hook) - scripts/stack-upgrade.sh — non-destructive upgrade: aborts on a dirty tree, fast-forward only, touches only the shared repo, reports changed *.example templates instead of overwriting machine-local copies - skills/stack-upgrade/SKILL.md — /stack-upgrade command (mirrors /gstack-upgrade) - UPDATING.md — the full model + the managed-block convention for inlined cases - README + CHANGELOG references Verified: bash -n on both scripts; update-check → UP_TO_DATE 1.0.0; upgrade correctly aborts on a dirty tree; 38 ai_docs tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Make the stack continuously improvable: users must be able to detect repo updates simply and apply them without losing their personalization (à la gstack).
Principle — reference, don't copy
Shared layer = this git clone. Personal configs only reference it (
@AGENTS.md). So an update is agit pullon the shared repo; personal files are never opened → zero personalization loss, even across users with totally differentCLAUDE.md.What
VERSION(semver) +stack-versionheader inAGENTS.md— version source of truth.scripts/stack-update-check.sh— read-only detection (fetch+ compare). EmitsUP_TO_DATE/UPGRADE_AVAILABLE old→new (N commits)/OFFLINE/NOT_A_CLONE. Safe in a SessionStart hook.scripts/stack-upgrade.sh— non-destructive: aborts on dirty tree,--ff-only, touches only the shared repo, reports changed*.exampletemplates instead of overwriting machine-local copies./stack-upgradeskill — mirrors/gstack-upgrade(detect → ask → upgrade → report).UPDATING.md— full model + the managed-block convention (STACK:BEGIN/END) for the rare inlined case.Verification
bash -nOK on both scriptsstack-update-check.sh→UP_TO_DATE 1.0.0stack-upgrade.shcorrectly aborts on a dirty working tree (protects edits)